<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>成都华联后台管理系统</title>
    <link rel="stylesheet" href="../../layui/css/layui.css"/>
    <script src="../../layui/layui.js"></script>
    <script>
        layui.use('element', function() {
            var $ = layui.jquery;  //加载jQuery模块
            var element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
        });
    </script>
    <script>var $ = layui.jquery;var form = layui.form;var layer = layui.layer;</script>
    <script>
        if (window.localStorage.getItem("auth")){
            $.ajax({

            })
        }else{
            window.location = "/adminLogin.html"
        }

    </script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">成都华联后台管理系统</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="">控制台</a></li>
            <li class="layui-nav-item"><a href="">优惠券管理</a></li>
            <li class="layui-nav-item"><a href="">用户</a></li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="/images/touxiang.jpg" class="layui-nav-img">

                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">基本资料</a></dd>
                    <dd><a href="">安全设置</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a id="exitBtn">退出</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
           <!-- lay-shrink: 展开时,收缩所有兄弟节点的子节点-->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test" lay-shrink="all">
                <li class="layui-nav-item layui-nav-itemed">
                    <a href="/cpList" target="menu-iframe">优惠券管理</a>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">会员管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/userList" target="menu-iframe">会员信息</a></dd>
                        <dd><a href="/userCpsList" target="menu-iframe">会员优惠券</a></dd>
                        <dd><a href="/wait.html" target="menu-iframe">优惠券核销清单</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">用户账户管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/wait.html" target="menu-iframe">新建账号</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a class="" href="javascript:;">积分管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/wait.html" target="menu-iframe" >品牌积分</a></dd>
                        <dd><a href="/wait.html" target="menu-iframe" >积分商品管理</a></dd>
                        <dd><a href="/wait.html" target="menu-iframe" >品牌管理</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;height:90%">
            <iframe id="menu-iframe" name="menu-iframe"
                    style="overflow: visible;height:100%" src="/cpList"
                    scrolling="auto" frameborder="no"  width="100%" height="100%"></iframe>
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © chengduhualian.com 成都华联
    </div>
</div>

    <script>
        $("#exitBtn").click(function (){
            $.ajax({
                url: "/admin"
                , type: "post"
                , headers: {"method": "exit"}
                , data: {

                }
                , dataType: "json"
                , success: function (result) {
                    if (result.code == 1) {
                        layer.msg('正在退出...',{icon:1,time:1000,shade:0.4},function() {
                            //清楚前端session和localStorage
                            window.sessionStorage.clear();
                            window.localStorage.removeItem("auth");
                            location.href = "/adminLogin.html";
                        });
                    } else if (result.code == 0) {
                        layer.msg(result.msg);
                    }
                }
            })
            return false;
        })
    </script>
</body>


</html>